package dhm.com.hpx.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.yhy.gvp.adapter.GVPAdapter;

import java.util.List;

import dhm.com.hpx.R;
import dhm.com.hpx.entity.IndexAllTypeBean;

public class IndexTypeAdapter extends GVPAdapter<IndexAllTypeBean.TypeListBean> {
    private Context context;
    public IndexTypeAdapter(Context context,int layoutResId, @Nullable List<IndexAllTypeBean.TypeListBean> data) {
        super(layoutResId, data);
        this.context=context;
    }

    @Override
    public void bind(View item, int position, IndexAllTypeBean.TypeListBean data) {
        ImageView iv_image=item.findViewById(R.id.iv_image);
        TextView tv_type_name=item.findViewById(R.id.tv_type_name);

        tv_type_name.setText(data.getName());

        iv_image.setImageResource(data.getImg());

    }
}